//
//  TalkfunBehaviorManager.h
//  TalkfunNewSDK
//
//  Created by 莫瑞权 on 2021/10/29.
//

#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
#define com_talk_fun_TalkfunLive   @"com.talk-fun.TalkfunLive"
#define com_talk_fun_HuanyunLive   @"com.talk-fun.HuanyunLive"
#define com_talk_fun_Kaijiang      @"com.talk-fun.Kaijiang"


#define TalkfunWriteData(print, parameters ) [TalkfunBehaviorManager writeData:print parameter: parameters line:[NSString stringWithFormat:@"%i",__LINE__] func: [NSString stringWithFormat: @"%s", __PRETTY_FUNCTION__] className:NSStringFromClass([self class])]


/*
  * 数据存储模型
  */
  
  @interface TFBehaviorData : NSObject
// 日期: 2021-11-03
  @property (nonatomic, strong) NSString *date;
//"路径: /var/xx/behavior/2021-11-03_1635924189.text"
  @property (nonatomic, strong) NSString *path;
// 时间: 1635924189
  @property (nonatomic, strong) NSString *time;
  @end


@interface TalkfunBehaviorManager : NSObject

/**
     print 自定义打印
 parameter 参数
      line 所在的行数
     func  方法的名字
 className 类
 */
+ (void)writeData:(NSString*)print
        parameter:(NSDictionary *)parameter
             line:(NSString*)line
             func:(NSString*)func
              className:(NSString*)className;

/**查询本地的记录*/
+(NSArray <TFBehaviorData *>*_Nonnull)getFileList;

/**
  报告行为数据
  提交成功会删除本地文件
 */
+ (void)feedbackContent:(NSString*_Nonnull)content path:(NSString*)path
                  callback:(void (^_Nonnull)(NSInteger code , NSString *_Nonnull  msg))callback;
@end

NS_ASSUME_NONNULL_END
